package com.hk.web.domain.entity;

import com.hk.commons.domain.entity.IdEntity;
import com.hk.commons.enums.AuthMenuType;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;

/**
 *
 * @author Antinomy
 * @date 17/7/25
 */
@Entity
@DynamicInsert
@DynamicUpdate
@EntityListeners(AuditingEntityListener.class)
public class AuthMenuItem extends IdEntity {

    @Column(columnDefinition = "varchar(100) NOT NULL UNIQUE comment '唯一ID'")
    private String uniqueId;

    @Column(columnDefinition = "varchar(50) comment '名称'")
    private String label;

    @Column(columnDefinition = "varchar(50) comment '路由地址'")
    private String router;

    @Column(columnDefinition = "varchar(40) NOT NULL comment '菜单类型' ")
    @Enumerated(EnumType.STRING)
    private AuthMenuType menuType;

    @Column(columnDefinition = "varchar(50) comment '父菜单Id'")
    private Long parentId;

    @Column(columnDefinition = "varchar(50) comment '图标'")
    private String icon;


    public String getLabel() {
        return label;
    }

    public String getRouter() {
        return router;
    }

    public AuthMenuType getMenuType() {
        return menuType;
    }


    public String getUniqueId() {
        return uniqueId;
    }

    public void setUniqueId(String uniqueId) {
        this.uniqueId = uniqueId;
    }

    public void setLabel(String label) {
        this.label = label;
    }

    public void setRouter(String router) {
        this.router = router;
    }

    public void setMenuType(AuthMenuType menuType) {
        this.menuType = menuType;
    }

    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }
}
